package com.soulkun.smarthome.ui.main.personal.viewmodel

import androidx.databinding.ObservableArrayList
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.soulkun.smarthome.logic.model.FamilyModel
import com.soulkun.smarthome.logic.repository.ApiRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import soulkun.library.mvvm.adapter.clearAndAddAll
import soulkun.library.utils.logE

class AppMainPersonalFamilyViewModel : ViewModel() {

    val familyList = ObservableArrayList<FamilyModel>()

    fun getFamilyNameList() = ApiRepository.getFamilyNameList(this){
        familyList.clearAndAddAll(it.data)
    }

}